package edu.mbb.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import edu.mbb.annocation.Autowried;
import edu.mbb.annocation.Controller;
import edu.mbb.annocation.RequestMapping;
import edu.mbb.bean.Emp;
import edu.mbb.service.EmpService;

@Controller
@RequestMapping("/test")
public class EmpController {

	@Autowried
	private EmpService employeeService;

	@RequestMapping("/doTest")
	public void test1(HttpServletRequest request, HttpServletResponse response, String param) {
		System.out.println(param);
		try {
			Emp byId = employeeService.findById(param);
			response.getWriter().write(byId.toString());
			// response.getWriter().write("doTest method success :
			// param:"+param);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@RequestMapping("/doTest2")
	public void test2(HttpServletRequest request, HttpServletResponse response) {
		try {
			response.getWriter().println("doTest2 success");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
